package com.xzy.ec.controller;

import com.xzy.ec.entity.GoodSpecsVO;
import com.xzy.ec.result.R;
import com.xzy.ec.service.impl.PmsGoodsSpecsImagesServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/PmsGoodsSpecsImages")
@Api(value = "PmsGoodsSpecsImagesController",tags = "商品图片控制器")
public class PmsGoodsSpecsImagesController {
    @Resource
    PmsGoodsSpecsImagesServiceImpl specsImagesService;
    //添加图片
    @PostMapping("/getAllGoodSpecsVO/{gid}/{imageUrl}")
    @ApiOperation(value = "addImageUrl",notes = "添加图片")
    public R addImageUrl(@ApiParam(value = "商品id", required = true)@PathVariable Integer gid,
                         @ApiParam(value = "图片地址", required = true)@PathVariable String imageUrl){
        boolean flag=specsImagesService.addImageUrl(gid,imageUrl);
        return R.ok().data("flag", flag);
    }
}
